# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-distro
_pkgname=distro
pkgver=1.6.0
pkgrel=2
pkgdesc='An OS platform information API.'
url='https://pypi.org/project/distro/#files'
arch=('any')
license=('Apache')
depends=('python2')
makedepends=('python2-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('d30334ed1137c54ddc70e041b75be905b7e13398483d0d92117eca0407d2a7b60424d96fd7af885a2e3ea3676b1aef620e91598a53309ae0da12a360d57ac013')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  mv "$pkgdir/usr/bin/$_pkgname" "$pkgdir/usr/bin/${_pkgname}2"
}

